<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>MRtrix documentation</title>
<link rel="stylesheet" href="../stylesheet.css" type="text/css" media=screen>
</head>
<body>

<table class=nav>
  <tr>
    <td><a href="roi.html"><img src="../left.png"></a></td>
    <td><a href="index.html"><img src="../up.png"></a></td>
    <td><a href="../index.html"><img src="../home.png"></a></td>
    <th>Performing fibre-tracking</th>
    <td><a href="../faq.html"><img src="../right.png"></a></td>
  </tr>
</table>

<h2><a name='example'>A simple example using the diffusion tensor</a></h2>
<p>
To illustrate the command syntax, we start with a very simple example of tensor-based fibre-tracking
(see e.g. <a href='../appendix/refs.html#mori'>Mori & van Zijl, 2002</a> for a review):
</p>
<pre>
&gt; <b><a href='../commands/streamtrack.html'>streamtrack</a> DT_STREAM dwi.mif -seed -5.3,17,-30.7,3 -mask mask.mif cst_dt.tck</b>
     122 generated,      100 selected    [100%]
</pre>
This generates 100 tracks (the default) using deterministic streamlines, 
with orientations calculated using the diffusion tensor model. 
The tracks are seeded at random from a spherical ROI position at [ -5.3 17 -30.7 ] with a 3 mm radius.
The mask image <kbd>mask.mif</kbd> is also specified to terminate tracks as they leave the brain.
The results are displayed below (see <a href='../general/mrview.html#tractography'>here</a> for more information on displaying results):
</p>
<img src=cst_dt.png>



<p class=sep><a href="#top">top</a></p>
<h2><a name='include'>Using a inclusion ROI</a></h2>
<p>
Multiple regions of interest can additionally be specified. 
For example, an <em>inclusion</em> region can be specified to discard tracks that do not pass through it:
</p>
<pre>
&gt; <b><a href='../commands/streamtrack.html'>streamtrack</a> DT_STREAM dwi.mif -seed -5.3,17,-30.7,4 -mask mask.mif cst_dt.tck -include -28,-14,53,30</b>
     173 generated,      100 selected    [100%]
</pre>
<img src=cst_dt_include.png>




<p class=sep><a href="#top">top</a></p>
<h2><a name='exclude'>Using a exclusion ROI</a></h2>
<p>
Alternatively, an <em>exclusion</em> region can be specified to discard tracks that <strong>do</strong> pass through it:
</p>
<pre>
&gt; <b><a href='../commands/streamtrack.html'>streamtrack</a> DT_STREAM dwi.mif -seed -5.3,17,-30.7,4 -mask mask.mif cst_dt.tck -exclude 27,16,21,20</b>
     124 generated,      100 selected    [100%]
</pre>
<img src=cst_dt_exclude.png>



<p class=sep><a href="#top">top</a></p>
<h2><a name='mask'>Using an image as a ROI</a></h2>
<p>
Any of these regions can also be specified as a mask image. 
The <a href='../general/mrview.html#roi'>ROI analysis tool</a> in <a href='../general/mrview.html'>MRView</a>
can be used to draw a specific ROI of interest, which can then be used for tracking
(see <a href='roi.html#mask'>here</a> for details).
For example, we generate a mask image called <kbd>seed.mif</kbd>, corresponding to both cortico-spinal tracts
at the level of the pons:
</p>
<img src='cst_seed.png'>
<p>
It can be used as a ROI for tracking simply by specifying this image instead of the 4-component spherical ROI specification:
</p>
<pre>
&gt; <b><a href='../commands/streamtrack.html'>streamtrack</a> DT_STREAM dwi.mif -seed seed.mif -mask mask.mif cst_dt.tck</b>
     133 generated,      100 selected    [100%]
</pre>
<img src='cst_dt_mask.png'>



<p class=sep><a href="#top">top</a></p>
<h2><a name='csd'>Tracking using spherical deconvolution</a></h2>
<p>
To perform fibre-tracking using the orientations provided by constrained spherical deconvolution, 
simply change the first argument to the <kbd><a href='../commands/streamtrack.html'>streamtrack</a></kbd> command to <kbd>SD_STREAM</kbd> or <kbd>SD_PROB</kbd>,
and supply the CSD SH coefficients file instead of the DWI image.
</p>
<p>
Specifying <kbd>SD_STREAM</kbd> as the tracking method will cause the program to use a deterministic fibre-tracking algorithm
that simply follows the peaks of the fibre orientation distribution.
</p>
<p>
Specifying <kbd>SD_PROB</kbd> as the tracking method will cause the program to use a probabilistic fibre-tracking algorithm 
that uses orientations sampled from the fibre orientation distribution at each step (similar to e.g. 
<a href='../appendix/refs.html#behrens'>Behrens <i>et al.</i>, 2003</a> and 
<a href='../appendix/refs.html#parker'>Parker <i>et al.</i>, 2003</a>).
</p>
<pre>
&gt; <b><a href='../commands/streamtrack.html'>streamtrack</a> SD_PROB CSD10.mif -seed seed.mif -mask mask.mif cst_csd.tck</b>
    1121 generated,     1000 selected    [100%]
</pre>
<img src='cst_csd.png'>




<p class=sep><a href="#top">top</a></p>
<h2><a name='wholebrain'>Whole brain tracking</a></h2>
<p>
Whole brain tracking can be performed for example by specifying the white matter mask image 
as the seed region, and the brain mask image as the mask ROI:
<pre>
&gt; <b><a href='../commands/streamtrack.html'>streamtrack</a> SD_PROB CSD10.mif -seed wm.mif -mask mask.mif whole_brain.tck -num 5000</b>
7311 generated,     5000 selected    [100%]
</pre>
<p>
Note that we do <b>not</b> recommend the use of the white matter mask for track termination 
(i.e. do not use it with the <kbd>-mask</kbd> option).
The white matter mask as generated by <a href='../commands/gen_WM_mask.html'>gen_WM_mask</a>
is rudimentary and derived using relatively ad-hoc methods. It is not suitable for applications 
that rely on an accurate white matter mask.
</p>
<img src='whole_brain.png'>



<table class=nav>
  <tr>
    <td><a href="roi.html"><img src="../left.png"></a></td>
    <td><a href="index.html"><img src="../up.png"></a></td>
    <td><a href="../index.html"><img src="../home.png"></a></td>
    <th><a href='#top'>top</a></th>
    <td><a href="../faq.html"><img src="../right.png"></a></td>
  </tr>
</table>

</body>
</html>


